package com.woniuxy.controller.info;

import java.util.List;

public class Result<T> {
    private String msg;
    private Integer code;
    private  T data;

    public static <D> Result<D> getInstance(Class<D> type){
        Result<D> dResult = new Result<D>();
        dResult.code=200;
        dResult.msg="成功";
        return dResult;
    }
    public static  Result<?> getInstance(){
        Result<?> dResult = new Result<>();
        dResult.data=null;
        dResult.code=200;
        dResult.msg="成功";
        return dResult;
    }

    public static <D> Result<List<D>> getInstanceList(Class<D> type){
        Result<List<D>> listResult = new Result<>();
        listResult.data=null;
        listResult.code=200;
        listResult.msg="成功";
        return listResult;

    }

    public String getMsg() {
        return msg;
    }

    public Result setMsg(String msg) {
        this.msg=msg;
        return this;
    }

    public Integer getCode() {
        return code;
    }

    public Result setCode(Integer code) {
        this.code = code;
        return this;
    }

    public T getData() {
        return data;
    }

    public Result setData(T data) {
        this.data = data;
        return this;
    }
}
